Merged from gtk-2-6:
authorFederico Mena Quintero <federico@ximian.com>
Wed, 2 Feb 2005 18:25:27 +0000 (18:25 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Wed, 2 Feb 2005 18:25:27 +0000 (18:25 +0000)
2005-02-02  Federico Mena Quintero  <federico@ximian.com>

Merged from gtk-2-6:

* gtk/gtkfilechooserdefault.c (pending_select_paths_process):
Don't select the first row if the chooser is not mapped.  This
happens when it's acting on behalf of GtkFileChooserButton.  Also,
don't select the first row if we are in SAVE or CREATE_FOLDER
modes --- I had missed that (see the ChangeLog entry from
2005-01-18).  Fixes #165264.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkfilechooserdefault.c

index 74841d4f8460c8156433588953f64d90e2b5530c..f6b5c92a82a675c20d687542a51187f24d7bda4e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2005-02-02  Federico Mena Quintero  <federico@ximian.com>
+
+       Merged from gtk-2-6:
+
+       * gtk/gtkfilechooserdefault.c (pending_select_paths_process):
+       Don't select the first row if the chooser is not mapped.  This
+       happens when it's acting on behalf of GtkFileChooserButton.  Also,
+       don't select the first row if we are in SAVE or CREATE_FOLDER
+       modes --- I had missed that (see the ChangeLog entry from
+       2005-01-18).  Fixes #165264.
+
 2005-02-02  Tor Lillqvist  <tml@novell.com>
 
        Implement lazy extended input initialization on Win32, by Robert
index 74841d4f8460c8156433588953f64d90e2b5530c..f6b5c92a82a675c20d687542a51187f24d7bda4e 100644 (file)
@@ -1,3 +1,14 @@
+2005-02-02  Federico Mena Quintero  <federico@ximian.com>
+
+       Merged from gtk-2-6:
+
+       * gtk/gtkfilechooserdefault.c (pending_select_paths_process):
+       Don't select the first row if the chooser is not mapped.  This
+       happens when it's acting on behalf of GtkFileChooserButton.  Also,
+       don't select the first row if we are in SAVE or CREATE_FOLDER
+       modes --- I had missed that (see the ChangeLog entry from
+       2005-01-18).  Fixes #165264.
+
 2005-02-02  Tor Lillqvist  <tml@novell.com>
 
        Implement lazy extended input initialization on Win32, by Robert
index 74841d4f8460c8156433588953f64d90e2b5530c..f6b5c92a82a675c20d687542a51187f24d7bda4e 100644 (file)
@@ -1,3 +1,14 @@
+2005-02-02  Federico Mena Quintero  <federico@ximian.com>
+
+       Merged from gtk-2-6:
+
+       * gtk/gtkfilechooserdefault.c (pending_select_paths_process):
+       Don't select the first row if the chooser is not mapped.  This
+       happens when it's acting on behalf of GtkFileChooserButton.  Also,
+       don't select the first row if we are in SAVE or CREATE_FOLDER
+       modes --- I had missed that (see the ChangeLog entry from
+       2005-01-18).  Fixes #165264.
+
 2005-02-02  Tor Lillqvist  <tml@novell.com>
 
        Implement lazy extended input initialization on Win32, by Robert
index c2e0f8e6031e47d24f0fad98cde1ac11436267fc..22738430bd4cf3f5de01d9c3f394e122bfe2ea8f 100644 (file)
@@ -4592,7 +4592,21 @@ pending_select_paths_process (GtkFileChooserDefault *impl)
       browse_files_center_selected_row (impl);
     }
   else
-    browse_files_select_first_row (impl);
+    {
+      /* We only select the first row if the chooser is actually mapped ---
+       * selecting the first row is to help the user when he is interacting with
+       * the chooser, but sometimes a chooser works not on behalf of the user,
+       * but rather on behalf of something else like GtkFileChooserButton.  In
+       * that case, the chooser's selection should be what the caller expects,
+       * as the user can't see that something else got selected.  See bug #165264.
+       *
+       * Also, we don't select the first file if we are in SAVE or CREATE_FOLDER
+       * modes.  Doing so would change the contents of the filename entry.
+       */
+      if (GTK_WIDGET_MAPPED (impl)
+         && !(impl->action == GTK_FILE_CHOOSER_ACTION_SAVE || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER))
+       browse_files_select_first_row (impl);
+    }
 
   g_assert (impl->pending_select_paths == NULL);
 }